<template>
  <view class="page">
    <u-sticky bgColor="#fff">
      <u-tabs
        :list="list"
        lineColor="#1AC678"
        itemStyle=" height: 60px;padding: 0 20px;"
        :activeStyle="{
          color: '#1AC678',
          fontWeight: 'bold',
        }"
        :inactiveStyle="{
          color: '#202020',
          fontWeight: 'bold',
        }"
      ></u-tabs>
    </u-sticky>
    <view class="main">
      <view
        class="item"
        @click="gotoPage('/pages/promotion/details')"
        v-for="(item, index) in 10"
        :key="index"
      >
        <image
          class="item-pic"
          src="https://img1.baidu.com/it/u=225041176,855892897&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=1422"
          mode="aspectFill"
        />
        <view style="flex: 1">
          <view class="item-title">病虫害知识库-病虫害案例</view>
          <view class="item-desc ellipsis-3"
            >根癌病是桃树上的一种主要根部细菌性病害，主
            要危害根部及根部颈部，形成肿瘤，造成桃树生
            长不良，植株矮小，果少质劣根癌病是桃树上的一种主要根部细菌性病害，主
            要危害根部及根部颈部，形成肿瘤，造成桃树生
            长不良，植株矮小，果少质劣...
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          name: "全部",
        },
        {
          name: "知识库一",
        },
        {
          name: "知识库二",
        },
      ],
    };
  },
  onLoad() {},
  methods: {
    click(item) {
      console.log("item", item);
    },
    gotoPage(value) {
      uni.navigateTo({
        url: value,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  width: 100%;
  // height: 100vh;
  background: #f6f6f6;
}
.search-box {
  width: 100%;
  height: 254rpx;
  background: #1ac678;
  padding-top: 108rpx;
  z-index: 20;
}
.search-input {
  width: 690rpx;
  height: 70rpx;
  border-radius: 53px 53px 53px 53px;
  margin: 0 auto;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 4rpx;
  padding-left: 40rpx;
  &-icon {
    width: 35rpx;
    height: 35rpx;
    margin-right: 25rpx;
  }
  &-put {
    flex: 1;
    font-size: r26rpx;
  }
  &-btn {
    width: 105rpx;
    height: 63rpx;
    background: #1ac678;
    border-radius: 53rpx;
    font-size: 28rpx;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
.main {
  padding: 35rpx 30rpx;
  .item {
    padding: 35rpx 23rpx;
    background: #fff;
    margin-bottom: 30rpx;
    display: flex;
    &-title {
      width: 100%;
      font-size: 28rpx;
      font-weight: bold;
      color: #202020;
      margin-bottom: 33rpx;
    }
    &-desc {
      font-size: 21rpx;
      color: #666666;
    }

    &-pic {
      width: 172rpx;
      height: 172rpx;
      background: #ffffff;
      border-radius: 14rpx;
      margin-right: 32rpx;
    }
  }
}
.btn-box {
  position: fixed;
  left: 0;
  bottom: 33rpx;
  width: 100%;
  // position: absolute;
  // bottom: 108rpx;
}
.btn {
  width: 697rpx;
  background: #1ac678;
  border-radius: 54rpx;
  margin: 0 auto;
  &-text {
    font-size: 32rpx;
    font-weight: 400;
    color: #ffffff;
  }
}
</style>
